package com.litong.litongjiaoyu.service.impl;

import com.litong.litongjiaoyu.dao.MenuDao;
import com.litong.litongjiaoyu.entity.SysFeatures;
import com.litong.litongjiaoyu.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName MenuServiceImpl
 * @Description 功能系统服务层具体实现
 * @Author jingz
 * @Date 2019/11/23 16:54
 * @Version 1.0
 **/
@Service
public class MenuServiceImpl implements MenuService {

    @Autowired
    private MenuDao menuDao;
    /**
     * 获取所有功能列表
     *
     * @return
     */
    @Override
    public List<SysFeatures> query() {
        return null;
    }

    /**
     * 添加职位时候，同时添加可使用的功能
     *
     * @param position_id
     * @param features_id
     * @return
     */
    @Override
    public int add(long position_id, long[] features_id) {
        return menuDao.add(position_id,features_id);
    }

    /**
     * 根据职位获取可用功能
     *
     * @param position_id
     * @return
     */
    @Override
    public List<SysFeatures> getAbleFeatures(long position_id) {
        return null;
    }

    /**
     * 删除sys_menu表中的相关信息
     *
     * @param position_id
     * @return
     */
    @Override
    public int remove(long position_id) {
        return 0;
    }

    /**
     * 根据职位获取可用功能编号
     *
     * @param position_id
     * @return
     */
    @Override
    public List<Integer> getAbleFeaturesId(int position_id) {
        return menuDao.getAbleFeaturesId(position_id);
    }
}
